package com.tyfspring.context.event;

import com.tyfspring.beans.exception.BeansException;
import com.tyfspring.beans.factory.BeanFactory;
import com.tyfspring.beans.factory.ConfigurableListableBeanFactory;
import com.tyfspring.context.ApplicationEvent;
import com.tyfspring.context.ApplicationListener;

/**
 * @Description TODO
 * @Author shallow
 * @Date 2023/4/14 19:38
 */

public class SimpleApplicationEventMuticaster extends AbstractApplicationEventMuticaster{


    public SimpleApplicationEventMuticaster(BeanFactory beanFactory){
        setBeanFactory(beanFactory);
    }

    @Override
    public void muticastEvent(ApplicationEvent event) {
        for (final ApplicationListener listener : getApplicationListeners(event)) {
            listener.onApplicationEvent(event);
        }
    }
}
